from litemall_0805.frame.pages.home_page import HomePage
from selenium.webdriver.common.by import By


class ClickMallMenu(HomePage):
    """
    实现【商场管理】下级菜单的点击
    """

    def click_goods_category(self):
        """
        点击二级菜单【商品类目】
        :return:
        """
        self.do_click(By.XPATH, "//*[text()='商品类目']")

        from litemall_0805.frame.pages.mall_manage.goods_category_list import GoodsCategoryList
        return GoodsCategoryList(self.driver)

    def click_order_manage(self):
        """
        点击二级菜单【订单管理】
        :return:
        """
        self.do_click(By.XPATH, "//*[text()='订单管理']")

        from litemall_0805.frame.pages.mall_manage.order_manage_list import OrderManageList
        return OrderManageList(self.driver)

    def click_brand_manufacturer(self):
        """
        点击二级菜单【品牌制造商】
        :return:
        """
        self.do_click(By.XPATH, "//*[text()='品牌制造商']")

        from litemall_0805.frame.pages.mall_manage.brand_manufacturer_list import BrandManufacturerList
        return BrandManufacturerList(self.driver)